/*
 * Copyright (c) 2020 pie4cloud Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.pie4cloud.pie.admin.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.pie4cloud.pie.common.mybatis.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * 字典项
 *
 * @author zzj
 * @date 2019/03/19
 */
@Data
@ApiModel(value = "字典项")
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "SYS_DICT_ITEM")
public class SysDictItem extends BaseEntity {

	private static final long serialVersionUID = 1L;

	/**
	 * 编号
	 */
	@Id
	@Column(name = "ID",length = 11)
	@TableId(value = "id", type = IdType.ASSIGN_ID)
	@ApiModelProperty(value = "字典项id")
	private Long id;

	/**
	 * 所属字典类id
	 */
	@ApiModelProperty(value = "所属字典类id")
	@Column(name = "DICT_ID",length = 11,nullable = false)
	private Long dictId;

	/**
	 * 数据值
	 */
	@ApiModelProperty(value = "数据值")
	@Column(name = "VALUE",length = 100)
	private String value;

	/**
	 * 标签名
	 */
	@ApiModelProperty(value = "标签名")
	@Column(name = "LABEL",length = 100)
	private String label;

	/**
	 * 类型
	 */
	@ApiModelProperty(value = "类型")
	@Column(name = "TYPE",length = 100)
	private String type;

	/**
	 * 描述
	 */
	@ApiModelProperty(value = "描述")
	@Column(name = "DESCRIPTION",length = 100)
	private String description;

	/**
	 * 排序（升序）
	 */
	@ApiModelProperty(value = "排序值，默认升序")
	@Column(name = "SORT",length = 1,columnDefinition = "INTEGER default 0")
	private Integer sort;

	/**
	 * 备注信息
	 */
	@ApiModelProperty(value = "备注信息")
	@Column(name = "REMARKS",length = 255)
	private String remarks;

	/**
	 * 删除标记
	 */
	@TableLogic
	@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
	@Column(name = "DEL_FLAG",length = 1,columnDefinition = "VARCHAR(1) DEFAULT '0'")
	private String delFlag;

}
